package io.sage.modules.statistics.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import io.sage.modules.statistics.vo.BStatisVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import io.sage.modules.statistics.dao.BStatisticsHumidityMapper;
import io.sage.modules.statistics.entity.BStatisticsHumidity;
import io.sage.modules.statistics.service.BStatisticsHumidityService;
/**
 * 传感器湿度服务
 * @author xjh
 *
 */
@Service("statisticsHumidityService")
public class BStatisticsHumidityServiceImpl implements BStatisticsHumidityService{

	@Autowired
	private BStatisticsHumidityMapper statisticsHumidityMapper;

	@Override
	public List<BStatisticsHumidity> selectStatisticsHumidityList(Map<String, Object> params) {
		// TODO Auto-generated method stub
		return statisticsHumidityMapper.selectStatisticsHumidityList(params);
	}

	@Override
	public BStatisticsHumidity selectById(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void deleteBatchIds(List<Integer> asList) {
		// TODO Auto-generated method stub

	}

	/**
	 * 添加单条传感器湿度数据
	 * @param goods
	 * @return
	 */
	@Override
	public int insert(BStatisticsHumidity statisticsHumidity) {
		statisticsHumidity.setCreateTime(new Date());
		statisticsHumidity.setIsDeleted(0);
		statisticsHumidity.setIsUsed(1);
		return statisticsHumidityMapper.insertSelective(statisticsHumidity);
	}

	/**
	 * 批量添加传感器的温度
	 * @param list
	 * @return
	 */
	@Override
	public int saveHumidityList(List<BStatisticsHumidity> list) {

		return statisticsHumidityMapper.saveHumidityList(list);
	}

	@Override
	public List<BStatisVo> selectListByWarehouseId(Map params) {
		return statisticsHumidityMapper.selectListByWarehouseId(params);
	}
}
